﻿<?php
$this->headLink()
        ->appendStylesheet($this->APP_STATIC_SERVER . '/skins/' . $this->APP_TEMPLATE . '/' . $this->APP_SKIN . '/css/contact.css');
$this->headScript()
        //->appendFile($this->APP_STATIC_SERVER . '/js/jquery.validate.min.js')
        ->appendFile($this->APP_STATIC_SERVER . '/js/jquery.ui/jquery.effects.core.min.js');

$message = $this->flashMessenger();
?>
<div id="m-center">
    <div class="center-box" id="contact-us">
        <div class="box-title">
            <div class="wrapper"><a class="root" href="#"><?php echo $this->translate('mail_contact_title') ?></a></div>
        </div>    
        <div class="box-container">
            <div id="google-maps">
                <img src="<?php echo $this->APP_STATIC_SERVER . '/skins/' . $this->APP_TEMPLATE . '/' . $this->APP_SKIN . '/images/map.jpg' ?>" width="630px" height="300px" alt=""/>
            </div>
            <div id="contact-form">
                <div class="form-title">
                    <div class="wrapper">
                        <?php echo $this->translate('mail_contact_form_title') ?>
                    </div>
                </div>
                
                <form name="frmContact" id="frmContact" action ="<?php echo $this->url(array(), 'mail_mail_contact') ?>" method="post">
                    <p class="guide"><?php echo $this->translate('mail_contact_form_guide') ?></p>
                    <div class ="error-box">
                        <ul <?php if($message) echo 'class = "success"'?>><?php if($message) echo $message; ?></ul>
                        
                    </div>
                    <div class="field">
                        <label for="name"><?php echo $this->translate('mail_contact_form_name') ?></label>
                        <input type="text" size="50" name="name" id="name" />
                    </div>    
                    <div class="field">
                        <label for="mail"><?php echo $this->translate('mail_contact_form_email') ?></label>
                        <input type="text" size="50" name="email" id="email"/>
                    </div>    
                    <div class="field">
                        <label for="subject"><?php echo $this->translate('mail_contact_form_subject') ?></label>
                        <input type="text" size="50" name="subject" id="subject"/>
                    </div>    
                    <div class="field">
                        <label for="message"><?php echo $this->translate('mail_contact_form_message') ?></label>
                        <textarea name="message" cols ="8" rows="5" id="message"></textarea>
                    </div>
                    <div class="field send-copy">
                        <label for="send_copy">
                            <input type="checkbox" name="send_copy" id="send_copy" value="1"/>
                            <span><?php echo $this->translate('mail_contact_send_copy') ?></span>
                        </label>
                    </div>
                    <div class="captcha">
                        <label>&nbsp;</label>
                        <div id="contact-captcha">
                            <script type="text/javascript">
                                var RecaptchaOptions = {
                                    custom_translations : {
                                        instructions_visual : "Enter two words:",
                                        instructions_audio : "Trascrivi ci\u00f2 che senti:",
                                        play_again : "Riascolta la traccia audio",
                                        cant_hear_this : "Scarica la traccia in formato MP3",
                                        visual_challenge : "Modalit\u00e0 visiva",
                                        audio_challenge : "Modalit\u00e0 auditiva",
                                        refresh_btn : "Chiedi due nuove parole",
                                        help_btn : "Aiuto",
                                        incorrect_try_again : "Scorretto. Riprova."
                                    },

                                    lang : 'en'
                                };
                            </script>
                            <script type="text/javascript" src="http://www.google.com/recaptcha/api/challenge?k=6LdHatASAAAAAJ-O5wIkrQgS7_ofgG2LRMnbKBif">
                            </script>
                            <noscript>
                            <iframe src="http://www.google.com/recaptcha/api/noscript?k=6LdHatASAAAAAJ-O5wIkrQgS7_ofgG2LRMnbKBif"
                                    height="300" width="500" frameborder="0"></iframe><br>
                            <textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
                            <input type="hidden" name="recaptcha_response_field" value="manual_challenge">
                            </noscript>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                    <div class="submit">
                        <input type="submit" name="send" id="send" value="<?php echo $this->translate('mail_contact_send') ?>"/>
                    </div>
                </form>
                <script type="text/javascript">
                    $(document).ready(function(){
                        $("#frmContact").validate({
                            rules: {
                                name: {
                                    required : true,
                                    maxlength: 255
                                },
                                email:{
                                    email: true,
                                    required: true
                                },
                                subject: {
                                    required : true,
                                    maxlength: 255
                                },
                                message:{
                                    required : true
                                }
                            },
                            messages :{
                                name: {
                                    required : "<?php echo $this->translate('mail_contact_name_required') ?>",
                                    maxlength: "<?php echo $this->translate('mail_contact_name_max_length') ?>"
                                },
                                email:{
                                    email: "<?php echo $this->translate('mail_contact_email_invalid') ?>",
                                    required: "<?php echo $this->translate('mail_contact_email_required') ?>"
                                },
                                subject: {
                                    required : "<?php echo $this->translate('mail_contact_subject_required') ?>",
                                    maxlength: "<?php echo $this->translate('mail_contact_subjext_max_length') ?>"
                                },
                                message:{
                                    required : "<?php echo $this->translate('mail_contact_message_required') ?>"
                                }
                            },
                            errorContainer: "#contact-form .error-box",
                            errorLabelContainer: "#contact-form .error-box ul",
                            wrapper: "li",
                            errorElement: 'b',
                            highlight: function(element, errorClass) {
                                $('#contact-form .error-box ul').html('').removeClass('success').addClass('error');
                                $(element).addClass('error');
                            }
  
                        });
                   
                    });
                </script>

            </div>
        </div>
    </div>
	<div class="m-center-footer">
        <h4>Thiết kế và thực hiện bởi <a href="http://idgit.com.vn">IDG-IT</a></h4>
    </div>

</div>

